<template>
	<view class="container">
		<uni-list>
			<uni-list-item showExtraIcon="true" :extraIcon="{type: 'person-filled'}" title="用户名"
				:rightText="user.nickName" />
			<uni-list-item showExtraIcon="true" :extraIcon="{type: 'phone-filled'}" title="注册号码"
				:rightText="user.phone" />
			<uni-list-item showExtraIcon="true" :extraIcon="{type: 'email-filled'}" title="所在城市"
				:rightText="user.cityName" />
			<uni-list-item showExtraIcon="true" :extraIcon="{type: 'auth-filled'}" title="所在小组" :rightText="user.teamName" />
		</uni-list>
	</view>
</template>

<script>
	import {
		getUserProfile
	} from "@/api/system/user"

	export default {
		data() {
			return {
				user: this.$store.state.user.userInfo,
			}
		},
		onLoad() {
			this.getUser()
		},
		methods: {
			getUser() {
				getUserProfile().then(response => {
					this.user = response.data
				})
			}
		}
	}
</script>

<style lang="scss">
	page {
		background-color: #ffffff;
	}
</style>